


interface RadioButtonProps {
    id: string;
    label: string;
    checked: boolean;
    rounded: string;
    img: string;
}

const RadioButton: React.FC<RadioButtonProps> = ({ id, label, checked , rounded, img}) => {
    return (
        <div className="btn-group" role="group" aria-label="Basic radio toggle button group">
            <input
                type="radio"
                className={rounded}
                name="btnradio"
                id={id}
                autoComplete="off"
                defaultChecked={checked}
            />
            <label className="btn btn-outline-primary" htmlFor={id}>
                <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor"
                     className="bi bi-person me-1" viewBox="0 0 17 17">
                    <path
                        d={img}/>
                </svg>
                {label}
            </label>
        </div>
    );
};

const TypeInput = () => {
    return (
        <div className="btn-group mt-2" role="group">
            <RadioButton id="btn-user" label="User" checked={true} rounded={"btn-check rounded-start-5"} img={"M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6m2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0m4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4m-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10s-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664z"}/>
            <RadioButton id="btn-admin" label="Admin" checked={false} rounded={"btn-check rounded-end-5"} img={"M11 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0M8 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4m.256 7a4.5 4.5 0 0 1-.229-1.004H3c.001-.246.154-.986.832-1.664C4.484 10.68 5.711 10 8 10q.39 0 .74.025c.226-.341.496-.65.804-.918Q8.844 9.002 8 9c-5 0-6 3-6 4s1 1 1 1zm3.63-4.54c.18-.613 1.048-.613 1.229 0l.043.148a.64.64 0 0 0 .921.382l.136-.074c.561-.306 1.175.308.87.869l-.075.136a.64.64 0 0 0 .382.92l.149.045c.612.18.612 1.048 0 1.229l-.15.043a.64.64 0 0 0-.38.921l.074.136c.305.561-.309 1.175-.87.87l-.136-.075a.64.64 0 0 0-.92.382l-.045.149c-.18.612-1.048.612-1.229 0l-.043-.15a.64.64 0 0 0-.921-.38l-.136.074c-.561.305-1.175-.309-.87-.87l.075-.136a.64.64 0 0 0-.382-.92l-.148-.045c-.613-.18-.613-1.048 0-1.229l.148-.043a.64.64 0 0 0 .382-.921l-.074-.136c-.306-.561.308-1.175.869-.87l.136.075a.64.64 0 0 0 .92-.382zM14 12.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0"}/>
        </div>
    );
};

export default TypeInput;
